package com.boot.sample.mybatis.controller;

import com.boot.sample.mybatis.domain.AccessLog;
import com.boot.sample.mybatis.domain.PrivateLetter;
import com.boot.sample.mybatis.mapper.AccessLogMapper;
import com.boot.sample.mybatis.mapper.PrivateLetterMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping(value = "privateletter")
public class PrivateLetterController {
    @Autowired
    private PrivateLetterMapper privateLetterMapper;
    @RequestMapping("")
    public String index(Long uid,Model m) {

        List<PrivateLetter> list = privateLetterMapper.findBySendUid(uid);

        m.addAttribute("list",list);
        return "private_letter";
    }

}
